🐙 Minimal, elegant, fast, async Kraken exchange REST API client | Written in Rust
Description
polipo
library aims to interface your software with the Kraken exchange REST API in no time.
Prerequisites
The Kraken exchange allows REST API
interaction with both public
and private
data.
Only for the private
one, you need to issue an API-Key
and an API-Secret
to the polipo
library, in order to generate authentication strings for signed requests.
If you are not familiar with, please have a look at API basics documentation for a general overview, or at Generate API keys document.
Implementation
Add this to your Cargo.toml
:
[]
= { = 0.2.5}
and then add this to your code
:
use polipo;
Methods
;
print_crate_info
Description: prints crate
information (name, description, version, author and repository).
;
set_kraken_api_credentials
Description: sets Kraken API
credentials for private
data access.
Required:
- api_key:
String
- api_secret:
String
.await;
get_kraken_api_response
Description: performs public
or private
requests, according to issued method
and url_encoded_body
data.
Required:
- method:
String
(eg: "public" or "private") - url_encoded_body:
String
(eg: "pair=ethusd&since=1574067140000000000")
Output: any response is in stringified JSON
format (parse accordingly with the outcome shape).
Example
The example below shows how easy is to implement polipo
from zero knowledge.
use polipo;
async
async
Disclaimer
This software comes without any kind of warranties.
I will not be liable for any damages related to the use or the misuse of this software.
You are the sole responsible.